package com.sakura.thread.chapter11;

/**
 * Created by apple on 2018/12/24.
 */
public class TestThread {
    static final String THREAD_SAVE_ORDER = "THREAD_SAVE_ORDER";
    static final String THREAD_SAVE_ADDR = "THREAD_SAVE_ADDR";

    public static void main(String[] args) {
        Thread threadOne = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("保存订单的线程");
                try {
                    Thread.sleep(500);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                throw new NullPointerException();
            }
        }, THREAD_SAVE_ORDER);

        Thread threadTwo = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("保存水货地址的线程");
            }
        }, THREAD_SAVE_ORDER);

        threadOne.start();;
        threadTwo.start();
    }
}
